/*
 *  Copyright 2007-2008 by Matthias Buch-Kromann <mbk.isv@cbs.dk>.
 *  *
 *  This file is part of the Open-source Dependency Toolkit (OSDT),
 *  see http://code.google.com/p/open-source-dependency-toolkit.
 *  
 *  The OSDT is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published
 *  by the Free Software Foundation, either version 3 of the License,
 *  or (at your option) any later version.
 * 
 *  The OSDT is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 * 
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with the OSDT in the file COPYING and COPYING.LESSER. If not, see
 *  http://www.gnu.org/licenses.
 */

package org.osdtsystem.graphs.views;

import org.osdtsystem.graphs.Graph;
import org.osdtsystem.graphs.io.GraphIDs;

/**
 * The public interface to a view that provides specialized access
 * to a particular intrpetation of a subgraph within a graph.  
 * @author Matthias Buch-Kromann <mbk.isv@cbs.dk>
 */
public interface View {
    // public void recompute();
    
    /**
     * Return an OSDT encoding of the view.
     * @param graph the graph
     * @param ids the ids assigned to layers, nodes, and views
     * @return a string containing the OSDT encoding 
     */
    public String toOSDT(Graph graph, GraphIDs ids);

    /**
     * Set the graph associated with the view and all its subviews.  
     * @param graph the new graph associated with the view
     */
    public void setGraph(Graph graph);

    /**
     * Create a new copy of the view and all its subviews.
     * @return the new view
     */
    public View copy();

    /**
     * Delete all nodes and edges in the view.
     */
    public void clear();

    /**
     * Recompute all internal variables defined by the view. This method is 
     * primarily used when the graph is decoded from an OSDT string representation
     * so that all internal variables must be recomputed.
     */
    public void recompute();
}
